Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prefer use of first line @echo off vs. @ per line to turn off echo pe… #873

Merged
merged 1 commit into from
Mar 6, 2016

Conversation

daxgames
Copy link
Member

@daxgames daxgames commented Mar 6, 2016

Prefer use of first line @echo off vs. @ per line to turn off echo per line. - Cleaner file, no side efects

@daxgames daxgames mentioned this pull request Mar 6, 2016
@jankatins
Copy link
Contributor

Hm, interesting, I really wonder why this comment is in the start-ssh-agent script:

@REM Do not use "echo off" to not affect any child calls.

https://github.com/git-for-windows/MINGW-packages/blob/master/mingw-w64-git/start-ssh-agent.cmd#L1

"Calls in the script" vs "calls after the script exits and the cmd is available for user commands"?

@jankatins
Copy link
Contributor

Just to make sure:

running this script and then runing a batch file without echo off will echo the commands?

I just tried to simulate that by calling echo off in the normal cmder windows and then a script, and it didn't work:

c:\data\external\cmder (where_is_git)
λ test.cmd

where /Q git.exe

if errorlevel 1 goto :VENDORED_GIT

goto :EOF

c:\data\external\cmder (where_is_git)
λ echo off
c:\data\external\cmder (where_is_git)
λ test.cmd
c:\data\external\cmder (where_is_git)
λ

@jankatins
Copy link
Contributor

Ok, it seems this only affects the calls form the init.bat, not something which happens after:

c:\data\external\cmder (where_is_git)
λ cat test2.bat
where git
echo off
echo
c:\data\external\cmder (where_is_git)
λ cmd /k test2.bat

c:\data\external\cmder {git}{hg}
{lamb} where git
Der Befehl "where" ist entweder falsch geschrieben oder
konnte nicht gefunden werden.

c:\data\external\cmder {git}{hg}
{lamb} echo off
ECHO ist ausgeschaltet (OFF).

c:\data\external\cmder {git}{hg}
{lamb} echo
ECHO ist eingeschaltet (ON).

c:\data\external\cmder {git}{hg}
{lamb}

Stanzilla added a commit that referenced this pull request Mar 6, 2016
Prefer use of first line @echo off vs. @ per line to turn off echo pe…
@Stanzilla Stanzilla merged commit 06c6e5f into cmderdev:development Mar 6, 2016
@daxgames
Copy link
Member Author

daxgames commented Mar 6, 2016

Correct. It turns off echo for the duration of the current script.

I did the exact same testing.

@daxgames daxgames deleted the echo_off branch March 6, 2016 23:10
@echo :: @set PATH=%%CMDER_ROOT%%\vendor\whatever;%%PATH%%
@echo.
echo :: use this file to run your own startup commands
echo :: use in front of the command to prevent printing the command
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line should be out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants